class StringTest {
	public static void main(String[] args) {
		String str="a,,b,,c,,d,,e,,f";
		String result=str.replaceAll(",+","|");
		System.out.println(result);
	}
}
